package com.wish.client;

import com.wish.datastructure.CalculatorPlus;
import com.wish.inter.datastructure.ICalculatorPlus;

import java.util.Scanner;

/**
 * Created by suliucheng on 2021/4/14 22:21
 * Directions:
 */
public class CalculatorPlusClient {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        ICalculatorPlus calculator = new CalculatorPlus();
        while(true){
            System.out.println("请输入一个合法的计算表达式：");
            String explain = scanner.next();
            if("quit".equals(explain)){
                break;
            }
            System.out.println(calculator.calculate(explain));
        }
        System.out.println("您已经退出计算。");
    }
}
